const http = require('http')

const options = {
  hostname: '127.0.0.1',
  port: 1337,
  path: '/'
}

const server = http.createServer((req, res) => {
  console.log(`${req.url}`)
  const request = http.request(options)
  request.end()

  request.on('information', (response) => {
    console.log(`在主响应之前获得信息: ${response.statusCode}`)
  })
})

server.listen('1337')
console.log('服务已启动')
